home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 25 / q25.d81 / t.control80 2 < prev    next >
Text File  |  2022-08-28  |  15KB  |  342 lines

  1.  
  2.  
  3.                           *** Control 80 V1.21 ***
  4.  
  5.                                by Jon Mattson
  6.  
  7.  
  8.     One of the greatest advantages of upgrading from a C-64 to a C-128 has
  9. got to be the 80-column RGB capability.  The improved resolution of the 8563
  10. chip puts the 128 on par with its much more expensive rivals from a graphics
  11. point of view.  Text displays, such as those used in word processors,
  12. benefit tremendously from the extra screen capacity, allowing the 128 to be
  13. used as a serious work machine.  For the not-so-serious, adventure games and
  14. the like can also take advantage of this extra space.  Then, too, there are
  15. all sorts of nifty graphic tricks that can be produced with the 8563.
  16.  
  17.     Unfortunately, 'tricks' might well be the operative word in that last
  18. paragraph.  If you have tried programming the 8563 at all, you probably
  19. discovered early on that it was no task to be taken lightly.  Using it at
  20. all can be quite a sleight of hand trick, in itself.  Since the chip has
  21. only a two byte 'window' into the 128's normal memory, even apparently
  22. simple tasks can be daunting.  Machine language knowledge is a virtual
  23. necessity for speedy graphics, since BASIC 7.0 virtually ignores the chip's
  24. existence.  Even the tried and true POKE and PEEK don't work!  Thus, if you
  25. aren't an ML wizard with a Programmer's Reference Guide, you probably had to
  26. content yourself with PRINT and the occasional SYS to ROM tricks.
  27.  
  28.     That was until now.  CONTROL80 changes all of that by adding 18 new
  29. keywords to BASIC 7.0: 16 commands and 2 functions that give you full and
  30. easy access to the 8563.  (See Foreword on the new MEGA command)
  31.  
  32.     Using C80 is simple. Just BLOAD it into memory and SYS 4864, either in
  33. direct mode or early on in your program.  If you are in direct mode, a
  34. message will inform you that it is installed.  This message will not appear
  35. from within a program, however, since it might ruin your screen
  36. presentation.  Generally, a simple BLOAD will suffice, but, if you have been
  37. playing around with BANKs and the like, you might want to use the full
  38. syntax: 
  39.  
  40.  BLOAD "CONTROL80",U(DV),B0,P4864     where DV is the current drive #
  41.  
  42.     Once C80 is installed, the new keywords can be used just like any other
  43. BASIC commands.  You can even abbreviate them by shifting the second letter,
  44. as usual.  Remember that C80 must be active (not just resident) while you
  45. type in a program using its keywords, or they will not be tokenized
  46. correctly.  Note also that C80 uses memory from 4864 to 6629 (only), so
  47. avoid POKEing around this area.
  48.  
  49.     Hitting the beloved STOP/RESTORE combination will not deactivate C80.
  50. The QUIT command (previously unimplemented on the 128) will turn it off,
  51. although SYS 4864 will bring it back to life.  Resetting the computer will
  52. also turn it off; however, due to its location, C80 will still be resident
  53. for later use as long as you haven't POKEd over its memory space.
  54.  
  55.     Now let's take a look at your new resources.  Certain conventions have
  56. been followed in this listing.  Memory addresses are 0-65535, as usual, to
  57. allow use with both 16K and 64K VDCs.  Note, however, that addresses above
  58. 16383 wrap around on the 16K chip (i.e. 16384 = 0).  Remember that the basic
  59. 8563 chip is set up as follows:
  60.  
  61.      $0000 - 07FF       0 - 2047    Screen
  62.      $0800 - 0FFF    2048 - 4095    Attribute
  63.      $1000 - 1FFF    4096 - 8191    Unused
  64.      $2000 - 2FFF    8192 - 12287   Upper Case/Graphic Char Set
  65.      $3000 - 3FFF   12288 - 16383   Lower/Upper Case Char Set
  66.  
  67. VDC register numbers (reg# below) range from 0-36.  While it is not within
  68. the scope of this article to explain the use of every register, a simplified
  69. table listing each one will be given in the Appendix.  A more complete
  70. description can be found in the C-128 Programmer's Reference Guide and many
  71. other sources.  When in doubt, experiment with WVD - just be sure that you
  72. check the registers normal value with RVD first to set things back to
  73. normal!
  74.  
  75. *** FUNCTIONS
  76.  
  77. PEER (VDC address)
  78.  
  79.     This function allows you to check the contents of VDC memory.  It
  80. operates just like BASIC's PEEK.  For example, to find the character in the
  81. top left corner of the screen: PRINT PEER(0).  Note that PEER is the
  82. counterpart of POST, below.
  83.  
  84. RVD (reg#)
  85.  
  86.     This function (Read ViDeo register) allows you to check the contents of
  87. any of the 37 VDC registers.  For example, A=RVD(12) would put the contents
  88. of register 12 in A.  Note that RVD is the counterpart of WVD, below.
  89.  
  90. *** COMMANDS
  91.  
  92. BLOCK VDC address, number, value
  93.  
  94.     This command is similar to FILL, below, except that it allows you to
  95. fill ANY small section of VDC memory with a single value.  "Address"
  96. indicates the starting position of the fill, and "number" (2-255) indicates
  97. how many locations to fill with the specified "value" (0-255) from that
  98. point on.  One of the best uses of BLOCK is to highlight a line on the
  99. screen by filling attribute memory with a different color value and/or
  100. reverse.  For example, BLOCK 2048,80,72 would highlight the entire first
  101. line of the screen by coloring it red and using reverse characters.
  102.  
  103. DUMP type
  104.  
  105.     This command dumps the entire 80 column screen display to any Commodore
  106. compatible printer.  Remember that the 8563 allows two character sets on the
  107. screen at the same time, but your printer will not: it will print the entire
  108. screen with the character set specified.  "Type" may be either 0 for an
  109. upper case/graphics dump or 7 for a lower/upper case dump.  These correspond
  110. to the normal and alternate character sets, respectively, in VDC terms.  If
  111. you must access DUMP in direct mode, remember that you can use ESCAPE-X to
  112. move to the 40-column screen and type the command there.
  113.  
  114.     If your printer is numbered 5 rather than 4, you can POKE the number
  115. into location 5965 and the screen will be dumped to Printer #5.  For
  116. instance:
  117.  
  118.  POKE5965,5:DUMP7
  119.  
  120. FCOPY address, bank, character set
  121.  
  122.     This command allows you to convert and copy a standard 40-column font
  123. already in normal memory at the "address" and "bank" specified to the 8563
  124. chip.  Since the 8563 allows two character sets simultaneously, you must
  125. specify which one to replace: 0 for upper case/graphics or 1 for lower/upper
  126. case.  For example, if you wanted to replace the uc/g set with your font,
  127. you might enter the following:
  128.  
  129.  BLOAD "font",U(DV),B0,P14336:FCOPY 14336,0,0
  130.  
  131. Note that you cannot simply VLOAD the font into 8563 memory, as the two
  132. formats are different and require conversion.  Once the font has been
  133. FCOPYed into the VDC, you could VSAVE that, but it is actually less
  134. efficient this way, taking up twice as much disk space and thus, twice as
  135. much loading time.  Stick with FCOPY if at all possible.
  136.  
  137. FILL screen type, value
  138.  
  139.     This command allows you to fill either screen ("type" 0) or attribute
  140. ("type" 1) memory with a single "value" from 0-255.  Screen codes are as per
  141. usual.  Attribute codes include color, reverse, flash and the like:
  142.  
  143.    Bit 7 (128)  Alternate Character Set
  144.        6 (64)   Reverse Video
  145.        5 (32)   Underline
  146.        4 (16)   Flash
  147.        3 (8)    Red
  148.        2 (4)    Green
  149.        1 (2)    Blue
  150.        0 (1)    Intensity
  151.  
  152. For example, FILL 1,154 will cause all characters to turn purple, flash and
  153. use the alternate character set.
  154.  
  155. FINIT
  156.  
  157.     This command simply reinitializes the 8563's normal fonts.  It is useful
  158. for cancelling the effects of FCOPY or undesirable POSTs into character
  159. memory.
  160.  
  161. HOME
  162.  
  163.     Homes the cursor within the current window.
  164.  
  165. LCLEAR first line, last line
  166.  
  167.     This command clears the indicated lines (0-24), including any unusual
  168. attribute effects such as flash and the like.  Naturally, the last line must
  169. be higher than or equal to the value of the first.  Note that lines are only
  170. cleared within the boundaries of the current window, and the line values
  171. will be offset by the position of the window from the real top of the
  172. screen.  Thus, the 0-24 range assumes a full-screen window and will be
  173. smaller for smaller windows.
  174.  
  175. POST VDC address, value
  176.  
  177.     This command allows you to place values into 8563 memory.  It operates
  178. just like BASIC's POKE.  For example, POST 0,1 will place an "A" in the top
  179. left corner of the scree